package cn.myframe.consumer;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

/*******************
 *@Describe
 *@author 封神梦
 *@Time 2022/3/24
 *@Company http://com.yiview.com
 ****************/@Component
public class MessageConsumer {
     @KafkaListener(topics = {"my-topic"})
    @SendTo("confirm-topic")
    public  String consum(MessageEvent event){
         return event.toString();
     }

     @KafkaListener(topics = {"other-topic"})
    public  void consumAnotherTopic(MessageEvent event){
          System.out.println("consumAnotherTopic:"+ event.toString());
     }
}
